import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout/index.vue'
import Login from '@/views/Login/index.vue'
import Home from '@/views/Home/index.vue'
import Articles from '@/views/Articles/index.vue'
import Images from '@/views/Images/index.vue'
import Comment from '@/views/Comment/index.vue'
import Fans from '@/views/Fans/index.vue'
import Setting from '@/views/Setting/index.vue'
// import
Vue.use(VueRouter)

const routes = [
  {
    name: 'Login',
    path: '/login',
    component: Login
  },
  {
    name: 'Layout',
    path: '/',
    component: Layout,
    children: [
      {
        name: 'Home',
        path: 'home',
        component: Home
      },
      {
        name: 'Articles',
        path: 'articles',
        component: Articles
      },
      {
        name: 'Images',
        path: 'images',
        component: Images
      },
      {
        name: 'Comment',
        path: 'comment',
        component: Comment
      },
      {
        name: 'Fans',
        path: 'fans',
        component: Fans
      },
      {
        name: 'Setting',
        path: 'setting',
        component: Setting
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
